package vip.liux.contracts.infrastructure.threads;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ThreadPoolConfig {

    @Bean("dynamicThreadPoolExecutor")
    public DynamicThreadPoolExecutor dynamicThreadPoolExecutor() {
        return new DynamicThreadPoolExecutor(
                5,      // 初始核心线程数
                20,     // 初始最大线程数
                60,     // 保活时间(秒)
                1000    // 初始队列容量
        );
    }
}